'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  // router.get('/', controller.home.index);

  //管理员登录
  router.get('/adminlogin', controller.loginController.adminlogin);
  //管理员注册
  router.post('/adminregister', controller.loginController.adminregister);
  //用户登录
  router.get('/userlogin', controller.loginController.userlogin);
  //获取所有书籍
  router.get('/getallbooks',controller.booksController.getAllbooks)
  //分页获取书籍列表
  router.get('/getbookslist',controller.booksController.getBooksCutPage)
  //添加书籍
  router.post('/addbooks',controller.booksController.addBooks)
  //查询书籍
  router.get('/searchBooks',controller.booksController.searchBooks)
  //修改书籍
  router.put('/editbooks',controller.booksController.editBooks)
  //删除书籍
  router.get('/deletebooks',controller.booksController.removeBooks)
};
